package saxion.sensorframework.structuur;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * The Sensor class wich defines a sensor with its datastructure(Types and
 * fields). <br>
 * Classes can be used for converting xml document to Sensor object
 * 
 * @author Erik & Martijn
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Sensor {

	private int id;
	private String name;
	private String description;

	private List<DataStruc> datastruc;

	public Sensor() {

	}

	/**
	 * Get the id of the Sensor wich is generated by the database after
	 * insertion
	 * 
	 * @return int Id
	 */
	public int getId() {
		return id;
	}

	/**
	 * Get the Sensor's name
	 * 
	 * @return String name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Get the Sensor's description
	 * 
	 * @return String description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Get the list of the Sensor's datastructure
	 * 
	 * @return List<DataStruc>
	 */
	public List<DataStruc> getDatastructuur() {
		return datastruc;
	}

	/**
	 * Set the Id of the Sensor
	 * 
	 * @param id
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * Set the name of the Sensor
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Set the description of the Sensor
	 * 
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Set the Datastructure of the Sensor
	 * 
	 * @param datastruc
	 */
	public void setDatastructuur(List<DataStruc> datastruc) {
		this.datastruc = datastruc;
	}

	/**
	 * Returns the Sensor object as a String
	 * 
	 * @return Sensor string with all the fields
	 */
	public String toString() {
		return "Name: " + this.name + "; Description: " + this.description;
	}

}
